                <div class="content col-xs-12 col-sm-10">
                        <div class="top">
                            <div class="row" style="margin: 0;">
                                <div class="left col-xs-12 col-sm-6">
                                    <h2 class="title">登陆状态</h2>
                                    <div class="data">
                                        <p>尊敬的<span class="blue"><?php echo $_SESSION['username'];?></span>用户，您好！</p>
                                        <p>这是您第<span class="blue"><?php echo $_SESSION['count'];?></span>次登录系统，上次登录时间为<span class="blue"><?php echo date("Y-m-d H:i:s", $_SESSION['lastTime']); ?></span></p>
                                    </div>
                                </div>
                                <div class="right col-xs-12  col-sm-6">
                                    <h2 class="title">设备状态</h2>
                                    <div class="data">
                                        <p>您共管理<span class="green"><?php echo $report['total'];?></span>台动车应急升弓装置</p>
                                        <div><span class="status status1">正常</span><span class="num"><?php echo $report['normal'];?>台</span><a href="/jhdy/allDevicedata/0">查看详情</a></div>
                                        <div><span class="status status2">急需充电</span><span class="num"><?php echo $report['lessCap'];?>台</span><a href="/jhdy/allDevicedata/2">查看详情</a></div>
                                        <div><span class="status status3">异常</span><span class="num"><?php echo $report['abnormal'];?>台</span><a href="/jhdy/allDevicedata/1">查看详情</a></div>
                                    </div>          
                                </div>
                            </div>
                        </div>
                    
                        <div class="bottom">
                            <div class="chartsContainer"></div>
                        </div>
                    
                </div>
            </div>
        </div>
 
<?php

 $lessCap = array();
                         $normal = array();
                         $abnormal = array();
                         $datetimes = array();

                         for($i=count($recentReport)-1;$i>=0; $i--)
                        {
                            $item = $recentReport[$i];
                            $lessCap[] = $item['lessCap'];
                            $normal[] = $item['normal'];
                            $abnormal[] = $item['abnormal'];
                            $datetimes[] = date("Y-m-d",$item['dtime']);
                        }

 ?>
        <script>
            $(document).ready(function() {
               var title = {
                  text: '电源状态统计'   
               };
               var subtitle = {
                  text: '最近20次'
               };
               var xAxis = {
                  categories: <?php echo json_encode($datetimes); ?>,
                   gridLineWidth: 1,
                   lineWidth: 2 //基线宽度
               };
               var credits = {
                    enabled: false   //右下角不显示LOGO
               };
               var yAxis = {
                  title: {
                     text: '数量'
                  },
                   tickInterval:3,
                   gridLineWidth: 1,
                   lineWidth: 2 //基线宽度
               };   
               var exporting = {
                    enabled: false  //设置导出按钮不可用
                };
               var tooltip = {
                  valueSuffix: '\xB0'
               };

               var legend = {
                  layout: 'horizontal',  //图例显示的样式：水平（horizontal）/垂直（vertical）
                    backgroundColor: '#ffc', //图例背景色
                    align: 'left',  //图例水平对齐方式
                    verticalAlign: 'top',  //图例垂直对齐方式
                    x: 100,  //相对X位
                    y: 15,   //相对Y位移
                    floating: true, //设置可浮动
                    shadow: true  //设置阴影
               };

               var series =  [
                  {
                     name: '正常',
                    data: <?php echo json_encode($normal,JSON_NUMERIC_CHECK); ?>
                  }, 
                  {
                     name: '急需充电',
                    data: <?php echo json_encode($lessCap,JSON_NUMERIC_CHECK); ?>
                  },
                  {
                     name: '异常',
                    data: <?php echo json_encode($abnormal,JSON_NUMERIC_CHECK); ?>
                  }
               ];
               var plotOptions = {
                    line: {
                        dataLabels: {
                            enabled: true
                        },
                    }
                };
                var colors = [ "#2ECC71","#F7D033","#F96E60" ];

               var json = {};

               json.title = title;
               json.subtitle = subtitle;
               json.xAxis = xAxis;
               json.yAxis = yAxis;
               json.tooltip = tooltip;
               json.legend = legend;
               json.series = series;
               json.plotOptions = plotOptions;
               json.credits = credits;
               json.exporting = exporting;
               json.colors = colors;

               $('.chartsContainer').highcharts(json);
            });
        </script>
    